dojo.declare("MRegistrationPg", wm.Page, {
start: function() {
},
"preferredDevice": "phone",
svLoginSuccess: function(inSender, inDeprecated) {
},
svLoginResult: function(inSender, inDeprecated) {
try {
var result = inSender.getItem(0);
if (result.data.authenticated === true || result.data.authenticated === 'true') {
this.notifyLogin.update();
var mainPage = wm.Page.getPage("MobileMainPg");
mainPage.vUserName = result.data.name;
mainPage.vUserEmail = result.data.email;
mainPage.vUserId = result.data.customerId;
mainPage.vProjectId = result.data.projectId;
mainPage.headerPanel.setShowing(false);
if (result.data.roles === 'CUSTOMER') {
mainPage.ncCustomerService.update();
} else if (result.data.roles === 'VENDOR') {
mainPage.ncVendorHomePg.update();
} else if (result.data.roles === 'ADMIN') {
mainPage.ncCustomerService.update();
}
} else {
this.notifyLoginError.update();
this.loginErrorMsg.setCaption("Invalid username or password.");
this.usernameInput.focus();
}
} catch (e) {
this.label1.caption = e;
}
},
buttonRegistrationClick: function(inSender) {
var isValid = true;
if (!this.textActivationCode.getDataValue() || (this.textActivationCode && this.textActivationCode.getDataValue() === "")) {
isValid = false;
}
if (!this.emailEditor1.getDataValue() || (this.emailEditor1 && this.emailEditor1.getDataValue() === "")) {
isValid = false;
}
if (!this.passwordEditor1.getDataValue() || (this.passwordEditor1 && this.passwordEditor1.getDataValue() === "")) {
isValid = false;
}
if (!this.nameEditor1.getDataValue() || (this.nameEditor1 && this.nameEditor1.getDataValue() === "")) {
isValid = false;
}
if (!this.lookupBlocks.getDataValue() || (this.lookupBlocks && this.lookupBlocks.getDataValue() === "")) {
isValid = false;
}
if (!this.lookupDoor.getDataValue() || (this.lookupDoor && this.lookupDoor.getDataValue() === "")) {
isValid = false;
}
if (!this.primaryPhoneEditor1.getDataValue() || (this.primaryPhoneEditor1 && this.primaryPhoneEditor1.getDataValue() === "")) {
isValid = false;
}
if (isValid) {
this.svRegistration.update();
} else {
this.ncRequiredFields.update();
}
},
picture1Click: function(inSender) {
this.picture2.setShowing(true);
this.picture1.setShowing(false);
},
picture2Click: function(inSender) {
this.picture2.setShowing(false);
this.picture1.setShowing(true);
},
_end: 0
});

MRegistrationPg.widgets = {
svRegistration: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"register","service":"RegistrationService"}, {"onSuccess":"notifyRegistration","onSuccess1":"layerLogin"}, {
input: ["wm.ServiceInput", {"type":"registerInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire1: ["wm.Wire", {"expression":undefined,"source":"textActivationCode.dataValue","targetProperty":"activationCode"}, {}],
wire: ["wm.Wire", {"expression":undefined,"source":"blockEditor1.dataValue","targetProperty":"customer.block"}, {}],
wire3: ["wm.Wire", {"expression":undefined,"source":"passwordEditor1.dataValue","targetProperty":"customer.password"}, {}],
wire4: ["wm.Wire", {"expression":undefined,"source":"secondaryPhoneEditor1.dataValue","targetProperty":"customer.secondaryPhone"}, {}],
wire5: ["wm.Wire", {"expression":undefined,"source":"primaryPhoneEditor1.dataValue","targetProperty":"customer.primaryPhone"}, {}],
wire6: ["wm.Wire", {"expression":undefined,"source":"nameEditor1.dataValue","targetProperty":"customer.name"}, {}],
wire7: ["wm.Wire", {"expression":undefined,"source":"emailEditor1.dataValue","targetProperty":"customer.email"}, {}]
}]
}]
}],
notifyRegistration: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"Registered Successfully.Please login  using the credentials\"","targetProperty":"text"}, {}],
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}],
wire1: ["wm.Wire", {"expression":"4000","targetProperty":"duration"}, {}]
}]
}]
}],
svLogin: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"retrieveUserDetails","service":"RegistrationService"}, {"onResult":"svLoginResult","onSuccess":"svLoginSuccess"}, {
input: ["wm.ServiceInput", {"type":"retrieveUserDetailsInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"usernameInput.dataValue","targetProperty":"email"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"passwordInput.dataValue","targetProperty":"password"}, {}]
}]
}]
}],
notifyLogin: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}],
wire1: ["wm.Wire", {"expression":"4000","targetProperty":"duration"}, {}],
wire: ["wm.Wire", {"expression":"\"Logged in Successfully\"","targetProperty":"text"}, {}]
}]
}]
}],
notifyLoginError: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}],
wire1: ["wm.Wire", {"expression":"4000","targetProperty":"duration"}, {}],
wire: ["wm.Wire", {"expression":"\"User not found\"","targetProperty":"text"}, {}],
wire2: ["wm.Wire", {"expression":"\"Error\"","targetProperty":"cssClasses"}, {}]
}]
}]
}],
variable1: ["wm.Variable", {"isList":true,"json":"[{name: \"Sunday\", dataValue: 0}, {name: \"Monday\", dataValue: 1},{name: \"Tuesday\", dataValue: 2},{name: \"Wednesday\", dataValue: 3},{name: \"Thursday\", dataValue: 4},{name: \"Friday\", dataValue: 5},{name: \"Saturday\", dataValue: 6}]","type":"EntryData"}, {}],
lvBlocks: ["wm.LiveVariable", {"autoUpdate":false,"inFlightBehavior":"executeLast","startUpdate":false,"type":"com.servicelivedb.data.Block"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"textActivationCode.dataValue","targetProperty":"filter.project.projectId"}, {}]
}],
liveView: ["wm.LiveView", {"dataType":"com.servicelivedb.data.Block","view":[{"caption":"BlockId","sortable":true,"dataIndex":"blockId","type":"java.lang.Integer","displayType":"Number","required":true,"readonly":true,"includeLists":true,"includeForms":true,"order":0,"subType":null},{"caption":"BlockName","sortable":true,"dataIndex":"blockName","type":"java.lang.String","displayType":"Text","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1,"subType":null}]}, {}]
}],
lvDoors: ["wm.LiveVariable", {"autoUpdate":false,"inFlightBehavior":"executeLast","startUpdate":false,"type":"com.servicelivedb.data.Door"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lookupBlocks.selectedItem.blockId","targetProperty":"filter.block.blockId"}, {}]
}],
liveView: ["wm.LiveView", {"dataType":"com.servicelivedb.data.Door","view":[{"caption":"DoorId","sortable":true,"dataIndex":"doorId","type":"java.lang.Integer","displayType":"Number","required":true,"readonly":true,"includeLists":true,"includeForms":true,"order":0,"subType":null},{"caption":"DoorName","sortable":true,"dataIndex":"doorName","type":"java.lang.String","displayType":"Text","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1,"subType":null}]}, {}]
}],
ncRequiredFields: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"Please enter the required fields\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"2000","targetProperty":"duration"}, {}],
wire2: ["wm.Wire", {"expression":"\"Warning\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"bottom center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
layoutBox1: ["wm.Layout", {"horizontalAlign":"left","verticalAlign":"top"}, {}, {
panel4: ["wm.Panel", {"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, {
toggleButtonPanel1: ["wm.ToggleButtonPanel", {"buttonMargins":"2","horizontalAlign":"left","manageHistory":true,"manageURL":true,"margin":"1","verticalAlign":"top"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"navButton1","targetProperty":"currentButton"}, {}]
}],
navButton1: ["wm.Button", {"border":"0,1,0,0","caption":"Login","height":"100%","margin":"2","width":"100%"}, {"onclick":"layerLogin"}],
navButton2: ["wm.Button", {"border":"0,1,0,0","caption":"Registration","height":"100%","margin":"2","width":"100%"}, {"onclick":"layerRegistration"}]
}],
panel2: ["wm.Panel", {"autoScroll":true,"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, {
layers1: ["wm.Layers", {"margin":"3,0,0,0","transition":"slide"}, {}, {
layerLogin: ["wm.Layer", {"borderColor":"","caption":"Please Login","horizontalAlign":"left","themeStyleType":"","verticalAlign":"top"}, {}, {
loginInputPanel: ["wm.HeaderContentPanel", {"_classes":{"domNode":["rounded"]},"desktopHeight":"222px","deviceType":null,"enableTouchHeight":true,"fitToContentHeight":true,"height":"152px","horizontalAlign":"center","margin":"5","mobileHeight":"290px","styles":{"color":""},"verticalAlign":"top","width":"100%"}, {"onEnterKeyPress":"loginButton.click"}, {
panel1: ["wm.Panel", {"height":"90px","horizontalAlign":"left","verticalAlign":"middle","width":"100%"}, {}, {
usernameInput: ["wm.Text", {"caption":"Email Id","captionAlign":"left","captionSize":"90px","dataValue":undefined,"desktopHeight":"35px","displayValue":"","height":"35px","placeHolder":"Email Id","regExp":"^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$","required":true,"width":"100%"}, {}],
passwordInput: ["wm.Text", {"caption":"Password","captionAlign":"left","captionSize":"90px","dataValue":undefined,"desktopHeight":"35px","displayValue":"","height":"35px","password":true,"placeHolder":"Password","required":true,"width":"100%"}, {}]
}],
loginButtonPanel: ["wm.Panel", {"height":"50px","horizontalAlign":"right","layoutKind":"left-to-right","padding":"4","width":"100%"}, {}, {
loginErrorMsg: ["wm.Label", {"align":"center","caption":" ","height":"100%","padding":"4","singleLine":false,"width":"100%"}, {}, {
format: ["wm.DataFormatter", {}, {}]
}],
loginButton: ["wm.Button", {"borderColor":"#000000","caption":"Login","height":"100%","margin":"4","width":"90px"}, {"onclick":"loginButtonClick","onclick2":"loadingDialog.show","onclick3":"loginVariable1","onclick4":"svLogin"}]
}]
}]
}],
layerRegistration: ["wm.Layer", {"autoScroll":true,"borderColor":"","caption":"Registration","horizontalAlign":"left","themeStyleType":"ContentPanel","verticalAlign":"top"}, {}, {
panelContent: ["wm.HeaderContentPanel", {"autoScroll":true,"height":"100%","horizontalAlign":"center","layoutKind":"left-to-right","margin":"5","verticalAlign":"top","width":"98%"}, {}, {
formPanel1: ["wm.FormPanel", {"captionSize":"1px","desktopHeight":"400px","deviceType":null,"editorHeight":"30px","height":"506px","mobileHeight":"506px","type":"com.servicelivedb.data.Customer","width":"95%"}, {}, {
labelAC: ["wm.Label", {"align":"center","caption":"Activation Code <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
textActivationCode: ["wm.Text", {"caption":"Activation Code","captionSize":"1px","dataValue":undefined,"displayValue":"","enableTouchHeight":false,"height":"30px","placeHolder":undefined,"required":true,"width":"100%"}, {"onchange":"lvBlocks"}],
labelAC1: ["wm.Label", {"align":"center","caption":"Email <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
emailEditor1: ["wm.Text", {"caption":"Email","captionSize":"1px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"30px","mobileHeight":"30px","placeHolder":"Email","required":true,"width":"100%"}, {}],
labelAC2: ["wm.Label", {"align":"center","caption":"Password <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
passwordEditor1: ["wm.Text", {"caption":"Password","captionSize":"1px","changeOnKey":true,"dataValue":"","displayValue":"","emptyValue":"emptyString","enableTouchHeight":false,"height":"30px","password":true,"placeHolder":"Password","required":true,"width":"100%"}, {}],
labelAC3: ["wm.Label", {"align":"center","caption":"Name <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
nameEditor1: ["wm.Text", {"caption":"Name","captionSize":"1px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"30px","mobileHeight":"30px","placeHolder":"Name","required":true,"width":"100%"}, {}],
labelAC4: ["wm.Label", {"align":"center","caption":"Block <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
lookupBlocks: ["wm.Lookup", {"caption":"lookup1","captionSize":"1px","dataType":"com.servicelivedb.data.Block","dataValue":undefined,"desktopHeight":"30px","displayField":"blockName","displayValue":"","height":"30px","mobileHeight":"30px","width":"100%"}, {"onchange":"lvDoors"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lvBlocks","targetProperty":"dataSet"}, {}]
}]
}],
labelAC5: ["wm.Label", {"align":"center","caption":"Door <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
lookupDoor: ["wm.Lookup", {"caption":"lookup1","captionSize":"1px","dataType":"com.servicelivedb.data.Door","dataValue":undefined,"desktopHeight":"35px","displayField":"doorName","displayValue":"","height":"30px","mobileHeight":"30px","width":"100%"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lvDoors","targetProperty":"dataSet"}, {}]
}]
}],
labelAC6: ["wm.Label", {"align":"center","caption":"Primary Phone <span style='color:red'>*</span>","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
primaryPhoneEditor1: ["wm.Text", {"caption":"PrimaryPhone","captionSize":"1px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"30px","mobileHeight":"30px","placeHolder":"Primary Phone","required":true,"width":"100%"}, {}],
labelAC7: ["wm.Label", {"align":"center","caption":"Secondary Phone","height":"20px","padding":"4","styles":{"fontWeight":"bold"},"width":"100%"}, {}],
secondaryPhoneEditor1: ["wm.Text", {"caption":"SecondaryPhone","captionSize":"1px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"30px","mobileHeight":"30px","placeHolder":"Secondary Phone","width":"100%"}, {}],
panel3: ["wm.Panel", {"desktopHeight":"32px","enableTouchHeight":true,"height":"100px","horizontalAlign":"center","layoutKind":"left-to-right","mobileHeight":"100px","verticalAlign":"top","width":"100%"}, {}, {
buttonRegistration: ["wm.Button", {"caption":"Register","desktopHeight":"30px","height":"40px","margin":"4"}, {"onclick":"buttonRegistrationClick"}]
}]
}]
}]
}]
}]
}]
}]
}]
};

MRegistrationPg.prototype._cssText = '';
MRegistrationPg.prototype._htmlText = '';